package com.zhijian.wharf.entity.vo.response;

import com.zhijian.wharf.enums.UserStatusEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import java.util.Objects;

/**
 * 人员 回显vo
 *
 * @author HCG
 * @version 1.0
 * @date 2022-01-01 15:41:25
 */
@Getter
@Api(tags = "人员回显vo")
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class UserVo implements Serializable {

    private static final long serialVersionUID = -1;

    /**
     * 主键id
     */
    @ApiModelProperty("主键id")
    private Long id;

    /**
     * 负责人名称
     */
    @ApiModelProperty("负责人名称")
    private String name;

    /**
     * 用户昵称
     */
    @ApiModelProperty("用户昵称")
    private String nickName;

    /**
     * 负责人电话
     */
    @ApiModelProperty("负责人电话")
    private String phone;

    /**
     * 工号
     */
    @ApiModelProperty("工号")
    private String jobNumber;

    /**
     * 状态，0：停用，1：正常
     */
    @ApiModelProperty("状态，0：停用，1：正常")
    private Byte status;

    /**
     * 状态字符串
     */
    @ApiModelProperty("状态字符串")
    private String statusStr;

    /**
     * 备注
     */
    @ApiModelProperty("备注")
    private String note;

    /**
     * 邮箱地址
     */
    @ApiModelProperty("邮箱地址")
    private String email;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    private String createTime;

    /**
     * 修改时间
     */
    @ApiModelProperty("修改时间")
    private String updateTime;

    /**
     * 角色id集合
     */
    @ApiModelProperty("角色id集合")
    private List<Long> roleIds;

    /**
     * 角色名称
     */
    @ApiModelProperty("角色名称")
    private String roleNames;

    /**
     * 客户层级，组织名称
     */
    @ApiModelProperty("客户层级，组织名称")
    private String groupName;

    /**
     * 客户id
     */
    @ApiModelProperty("客户id")
    private Long groupId;

    /**
     * 用户名
     */
    @ApiModelProperty("用户名")
    private String userName;

    /**
     * 消息通知接收人用户ID数组
     */
    @ApiModelProperty("消息通知接收人用户ID数组")
    private List<Long> msgReceiverUserIdList;

    /**
     * 扩展字段1
     */
    @ApiModelProperty("扩展字段1")
    private String ext1;

    /**
     * 扩展字段2
     */
    @ApiModelProperty("扩展字段2")
    private String ext2;

    /**
     * 头像
     */
    @ApiModelProperty("头像")
    private String avatar;

    /**
     * 小程序 openid
     */
    @ApiModelProperty("小程序 openid")
    private String miniOpenid;

    /**
     * 公众号openid
     */
    @ApiModelProperty("公众号openid")
    private String publicOpenid;

    /**
     * unionid
     */
    @ApiModelProperty("unionid")
    private String unionid;

    @ApiModelProperty("话费余额")
    private BigDecimal phoneBalance;

    public void setPhoneBalance(BigDecimal phoneBalance) {
        this.phoneBalance = phoneBalance;
    }

    public void setMiniOpenid(String miniOpenid) {
        this.miniOpenid = miniOpenid;
    }

    public void setPublicOpenid(String publicOpenid) {
        this.publicOpenid = publicOpenid;
    }

    public void setUnionid(String unionid) {
        this.unionid = unionid;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public void setExt1(String ext1) {
        this.ext1 = ext1;
    }

    public void setExt2(String ext2) {
        this.ext2 = ext2;
    }

    public void setMsgReceiverUserIdList(List<Long> msgReceiverUserIdList) {
        this.msgReceiverUserIdList = msgReceiverUserIdList;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public void setRoleNames(String roleNames) {
        this.roleNames = roleNames;
    }

    public void setGroupId(Long groupId) {
        this.groupId = groupId;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public void setJobNumber(String jobNumber) {
        this.jobNumber = jobNumber;
    }

    public void setStatus(Byte status) {
        this.status = status;
        if (Objects.isNull(status)) {
            this.statusStr = null;
            return;
        }
        UserStatusEnum lineEnum = UserStatusEnum.getByCode(status.intValue());
        this.statusStr = Objects.nonNull(lineEnum) ? lineEnum.getMsg() : null;
    }

    public void setStatusStr(String statusStr) {
        this.statusStr = statusStr;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public void setRoleIds(List<Long> roleIds) {
        this.roleIds = roleIds;
    }

}